/*
    该文件专门用于暴露一个 store 对象,整个应用只有一个 store 对象
*/

// 引入 createStore 用于创建 redux 中最为核心的 store 对象
import {createStore,applyMiddleware,combineReducers} from "redux"
// 引入为 Count 组件服务的 reducer
import countReducer from "./reducer/count"
import personReducer from "./reducer/person"


// 引入 redux-thunk 用于支持 异步
import thunk from "redux-thunk"
// 汇总所有 reducer 变为一个总的 reducer
const allReducer = combineReducers({
    sum:countReducer,
    persons:personReducer
})
// 暴露 store
export default createStore(allReducer,applyMiddleware(thunk))